<?php
require './boot.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="content-language" content="en" />
	<meta name="robots" content="noindex,nofollow" />
	<link rel="stylesheet" media="screen,projection" type="text/css" href="css/reset.css" /> <!-- RESET -->
	<link rel="stylesheet" media="screen,projection" type="text/css" href="css/main.css" /> <!-- MAIN STYLE SHEET -->
	<link rel="stylesheet" media="screen,projection" type="text/css" href="css/2col.css" title="2col" /> <!-- DEFAULT: 2 COLUMNS -->
	<link rel="alternate stylesheet" media="screen,projection" type="text/css" href="css/1col.css" title="1col" /> <!-- ALTERNATE: 1 COLUMN -->
	<!--[if lte IE 6]><link rel="stylesheet" media="screen,projection" type="text/css" href="css/main-ie6.css" /><![endif]--> <!-- MSIE6 -->
	<link rel="stylesheet" media="screen,projection" type="text/css" href="css/style.css" />
	<script type="text/javascript" src="../plugins/content/mootools.js"></script>
	<script type="text/javascript" src="../plugins/content/mootools-more.js"></script>

	<link rel="stylesheet" type="text/css" href="./js/Roar.css" />
	<script type="text/javascript" src="./js/Roar.js"></script>

	<script type="text/javascript" src="./js/sexyalertbox.js"></script>
	<link rel="stylesheet" type="text/css" href="./js/sexyalertbox.css" />

	<script type="text/javascript" src="./js/tabs-source.js"></script>
	
	<script type="text/javascript">
            window.addEvent('domready', function(){
    var accordion = new Accordion($$('.side-toggler'),$$('.side-element'), {
    	display: -1,
        opacity: 0
    	});
	});
	
	function redirect(page){
		window.location = "<?php echo $GLOBALS['url']; ?>"+page;
	}
	</script>
	
	<?php
echo "\n";
require '../plugins/editors/' . $GLOBALS['setting']['editor'] . '/' . $GLOBALS['setting']['editor'] .
    '.php';
echo "\n";
?>
	<title>VisionCMS - <?php echo Lang::getBackGlobal('title_admin'); ?></title>
</head>

<body>

<div id="main">

	<!-- Tray -->
	<div id="tray" class="box">

		<p class="f-left box">

			<!-- Switcher -->
			<span class="f-left" id="switcher">
				<a href="#" rel="1col" class="styleswitch ico-col1" title="Display one column"><img src="design/switcher-1col.gif" alt="1 Column" /></a>
				<a href="#" rel="2col" class="styleswitch ico-col2" title="Display two columns"><img src="design/switcher-2col.gif" alt="2 Columns" /></a>
			</span>

			<?php echo Lang::getBackGlobal('project') ?>: <strong><?php echo $GLOBALS['setting']['web_title']; ?></strong>

		</p>
		
		<?php
$utext = '<strong><a href="index.php?p=components&name=user&a=edit&id='.User::getUid().'">' . User::getDisplayName() . ' ('.rank2text($_SESSION['rank']).')</a></strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong><a href="login.php?q=logout" id="logout">'.Lang::getBackGlobal('logout').'</a></strong>';
?>

		<p class="f-right"><?php echo Lang::getBack('com_user', 'logged'); ?>: <?php echo $utext; ?></p>

	</div> <!--  /tray -->

	<hr class="noscreen" />

	<!-- Menu -->
	<div id="menu" class="box">

		<ul class="box f-right">
			<li><a href="<?php echo str_replace("administrator/", "", $GLOBALS['url']); ?>"><strong>Hlavní stránka &raquo;</strong></a></li>
		</ul>

		<ul class="box">
		<?php
foreach ($menu as $link => $text) {
	if($link != "index.php?p=components" and $link != "index.php?p=modules" and $link != "index.php?p=log"){
		$current = ("index.php?p=".$_GET['p'] == $link ) ? " id=\"menu-active\" " : ""; 
		echo '<li'.$current.' onclick="javascript:redirect(\''.$link.'\');"><input type="button" value="' . $text . '" style="cursor: pointer;" /></li>';
	}
}
?>
		</ul>

	</div> <!-- /header -->

	<hr class="noscreen" />

	<!-- Columns -->
	<div id="cols" class="box">

		<!-- Aside (Left Column) -->
		<div id="aside" class="box">

			<div class="padding box">

				<!-- Create a new project -->
				<p id="btn-create" class="box"><a href="index.php?p=components&amp;name=content&amp;a=new"><span>Napsat článek</span></a></p>
				<p id="btn-create" class="box"><a href="index.php?p=components&amp;name=custom&amp;a=new"><span>Vytvořit stránku</span></a></p>
<br />
			</div> <!-- /padding -->

			<ul class="box">
				<li><a href="index.php" class="report"><?php echo Lang::getBackGlobal('overview'); ?></a></li>
    		                <li><a href="index.php?p=log" class="report_seo"><?php echo Lang::getBackGlobal('log'); ?></a></li>
    		                <li><a href="index.php?p=about" class="report"><?php echo Lang::getBackGlobal('about'); ?></a></li>
    		                
                <li><a href="#">Uživatelé</a>
					<ul>
						<li><a href="index.php?p=components&amp;name=user" class="useradd"><?php echo Lang::getBack('com_user', 'list'); ?></a></li>
                            <li><a href="index.php?p=components&amp;name=user" class="group"><?php echo Lang::getBack('com_user', 'groups'); ?></a></li>
            				<li><a href="index.php?p=components&amp;name=user&amp;a=usearch" class="search"><?php echo Lang::getBack('com_user', 'search'); ?></a></li>
            				<li><a href="index.php?p=components&amp;name=user&amp;a=fields" class="search"><?php echo Lang::getBack('com_user', 'fields'); ?></a></li>
					</ul>
                </li>
                <li><br /></li>
				<li id="submenu-active" style="cursor: pointer;"><a class="side-toggler"><?php echo Lang::getBackGlobal('components'); ?></a> <!-- Active -->
					<ul class="side-element">
						<?php
                            require './modules/mod_components/mod_components.php';
                            ?>
					</ul>
				</li>
				<li><br /></li>
				<li id="submenu-active" style="cursor: pointer;"><a class="side-toggler"><?php echo Lang::getBackGlobal('modules'); ?></a> <!-- Active -->
					<ul class="side-element">
						<?php
                            require './modules/mod_modules/mod_modules.php';
                            ?>
					</ul>
				</li>
			</ul>

		</div> <!-- /aside -->

		<hr class="noscreen" />

		<!-- Content (Right Column) -->
		<div id="content" class="box">

				<?php
if (empty($_GET['p'])) {
    $view = 'bulletin';
} else {
    $view = addslashes($_GET['p']);
}

$_path = '.' . DIR_SEP . 'components' . DIR_SEP . 'com_' . $view . DIR_SEP .
    'com_' . $view . '.php';

if(is_file($_path)) require $_path;

?>
		</div> <!-- /content -->

	</div> <!-- /cols -->

	<hr class="noscreen" />

	<!-- Footer -->
	<div id="footer" class="box">

		<p class="f-left">&copy; 2009 <a href="#">VisionCMS</a>, All Rights Reserved &reg;</p>

		<!--<p class="f-right">Templates by <a href="http://www.adminizio.com/">Adminizio</a></p> -->

	</div> <!-- /footer -->

</div> <!-- /main -->
<script type="text/javascript">
    window.addEvent('load', function() {
	var roar = new Roar({
		position: 'lowerLeft',
		duration: 8000
	});

<?php
foreach ($Roar as $event) {
    echo $event . "\n";
}
?>
});
</script>
</body>
</html>